package com.spark.trouble

import android.app.Activity
import android.content.Intent
import android.os.Bundle
import com.spark.common.BaseActivity
import com.spark.trouble.message.HTMessageFragment

/**
 * 消息-隐患
 */
class HTMessageActivity : BaseActivity() {
    companion object {
        fun actionStart(host: Activity, data: String) {
            val intent = Intent(host, HTMessageActivity::class.java)
            intent.putExtra("data", data)
            host.startActivity(intent)
        }
    }

    override fun contentResId(): Int {
        return R.layout.act_container
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        intent?.apply {
            getStringExtra("data")?.apply {
                loadRootFragment(R.id.fl_content, HTMessageFragment.newInstance(this))
            }
        }
    }
}